home *** CD-ROM | disk | FTP | other *** search
/ The Ultimate Frank Lloyd…ght - America's Architect / Ultimate Frank Lloyd Wright, The - America's Architect (1994)(Microsoft Home).iso / pre / flw / flwli.dir / 00071_Script_71 < prev    next >
Text File  |  1994-11-15  |  16KB  |  564 lines

  1. --library movie for Frank Lloyd Project 
  2. --by Hamid Younessi August 94
  3.  
  4. ------------ S T A R T   M O V I E ------------------------------
  5. on startMovie
  6.   cursor 4
  7.   Global LObj
  8.   Global PageNum
  9.   Global BookNum
  10.   Global lastText, HiLiteSprite
  11.   Global FindNum
  12.   Global HiLi
  13.   Global nowframe
  14.   Global SeeAlsoNess
  15.   
  16.   set SeeAlsoNess = FALSE
  17.   set FindNum=1
  18.   set HiLi = -10000
  19.   
  20.   set HiLiteSprite = 7
  21.   
  22.   set BoxNum = 0
  23.   
  24.   set the puppet of Sprite 3 to TRUE
  25.   --  set the puppet of Sprite 7 to TRUE
  26.   set the puppet of Sprite 8 to TRUE
  27.   set the puppet of Sprite 9 to TRUE
  28.   set the puppet of Sprite 10 to TRUE
  29.   set the puppet of Sprite 11 to TRUE
  30.   set the puppet of Sprite 12 to TRUE
  31.   set the puppet of Sprite 14 to TRUE
  32.   set the puppet of Sprite 15 to TRUE
  33.   set the puppet of Sprite 16 to TRUE
  34.   set the puppet of Sprite 17 to TRUE
  35.   
  36.   set the puppet of Sprite HiLiteSprite to TRUE
  37.   
  38.   --  put " " into field A35
  39.   
  40.   put "" into field "searchBox"
  41.   put the text of field "searchBox" into LastText 
  42.   --  put " " into field A16
  43.   --  -- set the textFont of field A35 to "Times"
  44.   --  set the textFont of field A11 to "Times"
  45.   --  set the textSize of field A11 to 14
  46.   --  
  47.   --  set the textFont of field A16 to "Times"
  48.   --  set the textSize of field A16 to 12
  49.   --  set the textHeight of field A16 to 14
  50.   -- -- set the textSize of field A35 to 12
  51.   --  set the textFont of field A47 to "Times"
  52.   set the textHeight of field A47 to 15
  53.   --  set the textSize of field A47 to 10
  54.   
  55.   
  56.   
  57.   openXLib "FLWLib" -- opens FLWLib.DLL
  58.   if ObjectP(LObj) then LObj(mDispose)
  59.   set LOBJ = FLWLib(mNew)
  60.   
  61.   set dummy = " "
  62.   
  63.   --  LObj(minitialize, dummy)
  64.   set PageNum=0
  65.   
  66.   puppetSprite 21, TRUE
  67.   puppetSprite 22, TRUE
  68.   puppetSprite 23, TRUE
  69.   set the immediate of sprite 23 to TRUE
  70.   set the stretch of sprite 23 to FALSE
  71.   --  set the ink of sprite 23 to 8
  72.   
  73.   set the immediate of sprite 5 to TRUE
  74.   set the immediate of sprite 6 to TRUE
  75.   
  76.   --copy the first five indexes here
  77.   
  78.   put "Aalto, Alvar" into field "Ibox1"
  79.   put "Abercrombie and Fitch (New York)" into field "Ibox2"
  80.   put "Abstraction" into field "Ibox3"
  81.   put "Abstraction: definition of" into field "Ibox4"
  82.   put "Academic revival" into field "Ibox5"
  83.   
  84.   --    GetIndexes   --get indexes 
  85.   
  86.   
  87.   set nowFrame = "limai000000n°°"
  88.   
  89.   set the keydownscript to "if the key = ENTER or the key = RETURN then dontpassevent"
  90.   
  91.   cursor -1
  92. end startMovie
  93. -----------------------------------------------------------------------
  94.  
  95. on CheckForEntry
  96.   global HiLi
  97.   global lastText
  98.   global HiLiteSprite
  99.   
  100.   set HiLi = -10000
  101.   set the CastNum of Sprite HiLiteSprite to the number of Cast "UnHilite"
  102.   put " " into line 1 of field A47
  103.   put " " into line 3 of field A47
  104.   GetIndexes
  105.   set lastText = the text of cast "SearchBox"
  106. end CheckForEntry
  107.  
  108. -------------------S T O P   M O V I E ---------------------------------
  109. on stopMovie     
  110.   Global LObj
  111.   set dummy = " "
  112.   LObj(mend, dummy)
  113.   LObj(mDispose)
  114.   
  115.   CloseXLib"FLWLib"  
  116. end stopMovie
  117. ------------------------------------------------------------------------
  118.  
  119.  
  120. ------------------- B U T T O N   S T A T E ----------------------------
  121. on buttonState
  122.   global FrankNav, bFlag,hili
  123.   if hili <> -10000 then
  124.     if rollover(16) then
  125.       set the forecolor of sprite 17 to 255
  126.       puppetSprite 17,FALSE
  127.       puppetSprite 16,TRUE
  128.       set the forecolor of sprite 16 to 230
  129.       updateStage
  130.     else if rollover(17) then
  131.       set the forecolor of sprite 16 to 255
  132.       puppetSprite 16,FALSE
  133.       puppetSprite 17,TRUE
  134.       set the forecolor of sprite 17 to 230
  135.       updateStage
  136.     else
  137.       set the forecolor of sprite 16 to 255
  138.       set the forecolor of sprite 17 to 255
  139.       puppetSprite 16,FALSE
  140.       puppetSprite 17,FALSE
  141.     end if
  142.   end if
  143.   
  144.   
  145.   if rollover(5) then
  146.     puppetSprite 6,FALSE
  147.     puppetSprite 5,TRUE
  148.     set the castNum of sprite 5 to B12
  149.     updateStage
  150.   else if rollover(6) then
  151.     puppetSprite 5,FALSE
  152.     puppetSprite 6,TRUE
  153.     set the castNum of sprite 6 to B15
  154.     updateStage
  155.   else
  156.     set the castNum of sprite 5 to B11
  157.     set the castNum of sprite 6 to B14
  158.     puppetSprite 5,FALSE
  159.     puppetSprite 6,FALSE
  160.   end if
  161.   
  162.   if rollover(18) then
  163.     puppetSprite 19, FALSE
  164.     puppetSprite 18, TRUE
  165.     set the castNum of sprite 18 to A62
  166.     updateStage
  167.   else if rollover(19) then
  168.     puppetSprite 18, FALSE
  169.     puppetSprite 19, TRUE
  170.     set the castNum of sprite 19 to A63
  171.     updateStage
  172.   else
  173.     set the castNum of sprite 18 to A58
  174.     set the castNum of sprite 19 to A61
  175.     puppetSprite 18, FALSE
  176.     puppetSprite 19, FALSE
  177.   end if
  178.   
  179.   if (the mouseV > 200) or ( bFlag = TRUE) then
  180.     doState
  181.   end if
  182. end buttonState
  183. -------------------------------------------------------------------------
  184.  
  185.  
  186.  
  187.  
  188. ------------------- S A V E   L O C A L S ------------------------------
  189. on saveLocals
  190.   global nowFrame, lastMovie, lastFrame
  191.   set lastFrame = "limai000000n°°"
  192.   set lastMovie = "FLWLI"
  193. end saveLocals
  194. -------------------------------------------------------------------------
  195.  
  196. ------------------- F I N D   N E X T -----------------------------------
  197. on FindNext      
  198.   Global fFIND
  199.   Global SearchString
  200.   put fFIND
  201.   Global PageNum
  202.   
  203.   set PageNum = 0
  204.   
  205.   if fFIND = 1 then
  206.     set fFIND = 0  
  207.     set the castNum of sprite 3 to A14
  208.     UpdateStage
  209.   end if
  210.   
  211.   if fFIND = 0 then
  212.     set fFIND = 1
  213.     set the castNum of sprite 3 to A15 
  214.     UpdateStage  
  215.   end if
  216.   
  217. end FindNext
  218. ------------------------------------------------------------------------
  219.  
  220. ---------------------G E T   I N D E X E S -----------------------------
  221.  
  222. on GetIndexes     -- gets the five indexes after bp
  223.   Global Index1, Index2, Index3, Index4, Index5
  224.   Global SearchString
  225.   Global LObj
  226.   Global FindNum
  227.   Global PageNum
  228.   
  229.   set PageNum = 0
  230.   set FindNum=1
  231.   ---------------------------------------- 
  232.   -- with every key stroke set the text 
  233.   -- user just entered to SearchString 
  234.   ---------------------------------------- 
  235.   
  236.   put the text of cast "SearchBox" into searchstring
  237.   set Index1 = ""
  238.   set Index2 = ""
  239.   set Index3 = ""
  240.   set Index4 = ""
  241.   set Index5 = ""
  242.   set the text of cast "PageText" to ""
  243.   set dummy =" "
  244.   ---------------------------------------- 
  245.   -- go to DLL and set Index 1 through 5
  246.   ----------------------------------------
  247.   
  248.   LObj(mGetIndex, SearchString)  -- method that finds index and sets Index1 thru Index5
  249.   
  250.   -----------------------------------------
  251.   -- set the text of the IBoxes
  252.   -----------------------------------------
  253.   set the text of cast "IBox1" to Index1
  254.   set the text of cast "IBox2" to Index2
  255.   set the text of cast "IBox3" to Index3
  256.   set the text of cast "IBox4" to Index4
  257.   set the text of cast "IBox5" to Index5
  258.   updatestage
  259.   
  260. end GetIndexes
  261. -------------------------------------------------------------------------
  262.  
  263. ------------------G E T   T E X T ---------------------------------------
  264. on GetText    -- gets a page text for the bottom of the screen
  265.   Global FindNum, SearchText     -- passed to mGetText
  266.   Global boxNum                  -- lingo to keep track of box number
  267.   Global ShowText                -- Page of text 
  268.   Global LObj
  269.   Global PageNum
  270.   Global BookNum
  271.   Global HitNum
  272.   Global TotHit
  273.   Global err_check
  274.   Global nowFrame
  275.   Global HiLiStat
  276.   
  277.   global first_time 
  278.   
  279.   set ShowText = " "
  280.   
  281.   set SearchText to the text of cast ("IBox" & string(boxNum)) 
  282.   
  283.   set dummy= " "
  284.   
  285.   set err_check = LObj(mGetText, SearchText, FindNum, PageNum)
  286.   
  287.   if (err_check <> -15000) then
  288.     
  289.     set BookNum = LObj(mGetBookNum, dummy)
  290.     set HitNum = LObj (mGetHitNum, dummy)
  291.     set TotHit = LObj (mGetTotHitNum, dummy)
  292.     
  293.     if booknum = 1  then
  294.       set the castnum of sprite 14 to the number of cast "book1"
  295.     else if booknum = 2 then 
  296.       set the castnum of sprite 14 to the number of cast "book2"
  297.     else if booknum = 3 then
  298.       set the castnum of sprite 14 to the number of cast "book3"
  299.     else if booknum = 4 then 
  300.       set the castnum of sprite 14 to the number of cast "book4"
  301.     else if booknum = 5 then
  302.       set the castnum of sprite 14 to the number of cast "book5"
  303.     else if booknum = 6 then
  304.       set the castnum of sprite 14 to the number of cast "book6"
  305.     else if booknum = 7 then
  306.       set the castnum of sprite 14 to the number of cast "book7"  
  307.     end if  
  308.     
  309.     put HitNum into line 1 of field A47
  310.     put TotHit into line 3 of field A47 
  311.     
  312.     if TotHit <> 1 then
  313.       set nowFrame = "limai000000°°°"
  314.     else
  315.       set nowFrame = "limai000000n°°"
  316.     end if
  317.     
  318.     set the text of cast "PageText" to ShowText
  319.     
  320.     if (PageNum <> 0) then
  321.       set HiLiStat = LObj (mGetHiLiStat, dummy)
  322.       if (HiLiStat <> -1) then 
  323.         HiLine1
  324.       end if
  325.     else HiLine
  326.   end if
  327.   UpdateStage
  328.   
  329.   
  330.   
  331. end GetText
  332. ------------------------------------------------------------------------
  333.  
  334. ------------------------G E T   N E X T --------------------------------
  335. -- this functions is used by next and previous buttons on the bottom
  336. -- of the screen that go to next of previous occurance of a word
  337. on GetNext                       -- when clicked on get next next button
  338.   Global FindNum, SearchText     -- passed to mGetText
  339.   Global boxNum                  -- lingo to keep track of box number
  340.   Global ShowText                -- Page of text 
  341.   Global LObj
  342.   Global PageNum
  343.   Global BookNum
  344.   
  345.   
  346.   set PageNum=0
  347.   
  348.   set SearchText to the text of cast ("IBox" & string(boxNum)) 
  349.   
  350.   set dummy = " "
  351.   
  352.   set FindNum = LObj(mGetText, SearchText, FindNum, PageNum)
  353.   set BookNum = LObj(mGetBookNum, dummy)
  354.   set HitNum = LObj (mGetHitNum, dummy)
  355.   set TotHit = LObj (mGetTotHitNum, dummy)
  356.   
  357.   
  358.   if booknum = 1  then
  359.     set the castnum of sprite 14 to the number of cast "book1"
  360.   else if booknum = 2 then 
  361.     set the castnum of sprite 14 to the number of cast "book2"
  362.   else if booknum = 3 then
  363.     set the castnum of sprite 14 to the number of cast "book3"
  364.   else if booknum = 4 then 
  365.     set the castnum of sprite 14 to the number of cast "book4"
  366.   else if booknum = 5 then
  367.     set the castnum of sprite 14 to the number of cast "book5"
  368.   else if booknum = 6 then
  369.     set the castnum of sprite 14 to the number of cast "book6"
  370.   else if booknum = 7 then
  371.     set the castnum of sprite 14 to the number of cast "book7" 
  372.   end if  
  373.   
  374.   put HitNum into line 1 of field A47
  375.   put TotHit into line 3 of field A47 
  376.   
  377.   if TotHit <> 1 then
  378.     set nowFrame = "limai000000°°°"
  379.   else
  380.     set nowFrame = "limai000000n°°"
  381.   end if
  382.   
  383.   set the text of cast "PageText" to ShowText
  384.   HiLine
  385.   UpdateStage
  386.   
  387. end GetNext
  388. ------------------------------------------------------------------------
  389.  
  390. -------------------A R R O W   D O W N ---------------------------------
  391.  
  392. on ArrowDown   -- when the arrow down button is pressed
  393.   
  394.   Global Index1, Index2, Index3, Index4, Index5
  395.   Global SearchString
  396.   Global LObj
  397.   Global FindNum
  398.   Global BoxNum
  399.   Global HiLi
  400.   Global HiLiteSprite
  401.   
  402.   set testindex = the text of cast "Ibox1"
  403.   set dummy = " "
  404.   
  405.   set FindNum=1
  406.   ---------------------------------------- 
  407.   -- with every key stroke set the text 
  408.   -- user just entered to SearchString 
  409.   ---------------------------------------- 
  410.   set SearchString = the text of cast "Ibox2"
  411.   
  412.   --the next lines gets the next five indexes
  413.   
  414.   if (chars(SearchString,1,1) <> "") then
  415.     LObj(mGetIndex, SearchString)  -- method that finds index and sets Index1 thru Index5
  416.     
  417.     put the number of chars in testindex into maxlen 
  418.     
  419.     if HiLi <> -10000 and chars(testindex,1,maxlen) <> string (index1) then
  420.       set HiLi = HiLi - 1
  421.       if HiLi = 0 then --unhilite
  422.         set the CastNum of Sprite HiLiteSprite to the number of Cast "UnHilite"      
  423.       else if HiLi <= 5 and HILI >= 1 then
  424.         set the CastNum of Sprite HiLiteSprite to the number of cast "HiLite"
  425.         set the LocV of Sprite HiLiteSprite to the locV of Sprite (7+HiLi)      
  426.       end if
  427.     end if
  428.     -----------------------------------------
  429.     -- set the text of the IBoxes
  430.     -----------------------------------------
  431.     set the text of cast "IBox1" to Index1
  432.     set the text of cast "IBox2" to Index2
  433.     set the text of cast "IBox3" to Index3
  434.     set the text of cast "IBox4" to Index4
  435.     set the text of cast "IBox5" to Index5
  436.     
  437.     updatestage
  438.     
  439.   end if
  440.   
  441. end ArrowDown
  442. -------------------------------------------------------------------------
  443.  
  444. ----------------- A R R O W   U P ---------------------------------------
  445. on ArrowUp    --when arrow up button is pressed
  446.   
  447.   Global Index1, Index2, Index3, Index4, Index5
  448.   Global SearchString
  449.   Global LObj
  450.   Global FindNum
  451.   Global HiLi
  452.   Global HiLiteSprite
  453.   
  454.   set testindex = the text of cast "Ibox1"
  455.   set dummy = " "
  456.   
  457.   set FindNum=1
  458.   ---------------------------------------- 
  459.   -- with every key stroke set the text 
  460.   -- user just entered to SearchString 
  461.   ---------------------------------------- 
  462.   set SearchString = the text of cast "Ibox1"
  463.   
  464.   set Index1 = ""
  465.   set Index2 = ""
  466.   set Index3 = ""
  467.   set Index4 = ""
  468.   set Index5 = ""
  469.   
  470.   ---------------------------------------- 
  471.   -- go to DLL and set Index 1 through 5
  472.   
  473.   
  474.   LObj(mGetPrevIndex, SearchString)  -- method that finds index and sets Index1 thru Index5
  475.   
  476.   
  477.   put the number of chars in testindex into maxlen
  478.   
  479.   if HiLi <> -10000 and chars(testindex,1,maxlen) <> string (index1) then 
  480.     set HiLi = HiLi + 1
  481.     if HiLi = 6 then --unhilite
  482.       set the CastNum of Sprite HiLiteSprite to the number of cast "UnHilite"
  483.     else if HiLi >=1 and HiLi <=5 then
  484.       set the CastNum of Sprite HiLiteSprite to the number of cast "HiLite"
  485.       set the LocV of Sprite 7 to the locV of Sprite (7+HiLi)
  486.     end if
  487.   end if 
  488.   
  489.   -----------------------------------------
  490.   -- set the text of the IBoxes
  491.   -----------------------------------------
  492.   set the text of cast "IBox1" to Index1
  493.   set the text of cast "IBox2" to Index2
  494.   set the text of cast "IBox3" to Index3
  495.   set the text of cast "IBox4" to Index4
  496.   set the text of cast "IBox5" to Index5
  497.   
  498.   updatestage
  499.   
  500. end ArrowUp
  501. -----------------------------------------------------------------------
  502.  
  503. --------------- H I T   W O R D ---------------------------------------
  504. on hitWord lnNUm
  505.   hilite line lnNum of field A46
  506. end hitWord
  507. -----------------------------------------------------------------------
  508.  
  509. --------------- L I F O R S T E P -------------------------------------
  510. on liForStep
  511.   global FindNum
  512.   global HiLi
  513.   
  514.   if HiLi <> -10000 then
  515.     set FindNum = FindNum + 1
  516.     GetNext
  517.   end if
  518.   
  519. end liForStep
  520. -----------------------------------------------------------------------
  521.  
  522. --------------- L I B A C K S T E P -----------------------------------
  523. on liBackStep
  524.   Global FindNum
  525.   Global HiLi
  526.   if HiLi <> -10000 then 
  527.     --   if FindNum > 0 then
  528.     set FindNum = FindNum -1
  529.     --   end if
  530.     GetNext
  531.   end if
  532.   
  533. end liBackStep
  534. ------------------------------------------------------------------------
  535.  
  536. ----------------I N I T   P R E V   I N D E X ---------------------------
  537. on init_prev_offset
  538.   set dummy = " "
  539.   --  LObj(minit_prev_offset, dummy) --reinitializes the prev_offset
  540. end init_prev_offset
  541. ------------------------------------------------------------------------
  542. ------------------------------------------------------------------------
  543.  
  544. ----------------H I L I ---------------------------
  545. on HiLine
  546.   global line_num
  547.   global hiLineNum
  548.   global LObj
  549.   
  550.   set dummy = " "
  551.   set line_num = LObj(mGetLineNum, dummy)
  552.   hilite line line_num of field "Pagetext"
  553.   updatestage
  554. end HiLine
  555.  
  556. ----------------H I L I   1--------------------------
  557. on HiLine1
  558.   global HiLiStat
  559.   hilite line HiLiStat of field "Pagetext"
  560.   updatestage
  561. end HiLine1
  562.  
  563.  
  564.